// @author a
// @date
// @note
package utils

import (
	"sync"
)

var m map[string]string
var lock *sync.RWMutex

func init() {
	lock = new(sync.RWMutex)
	m = make(map[string]string)
}

func GetMapLock(key string) string {
	lock.RLock()
	value := m[key]
	lock.RUnlock()
	return value
}
func WriteMapLock(key string, value string) {
	lock.Lock()
	m[key] = value
	lock.Unlock()
}

func DelMapLock(key string) {
    lock.Lock()
    delete(m,key)
    lock.Unlock()
}
